<template>
  <div id="add_form">
    <el-form ref="form" :model="form" label-width="80px">

      <el-form-item label="活动名称">
        <el-input v-model="form.name"></el-input>
      </el-form-item>

      <el-form-item label="活动区域">
        <el-select v-model="form.region" placeholder="请选择活动区域">
          <el-option value="0" >区域一</el-option>
          <el-option value="1" >区域二</el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="特殊资源">
        <el-radio-group v-model="form.resource">
          <el-radio label="线上品牌商赞助"></el-radio>
          <el-radio label="线下场地免费"></el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSubmit">立即创建</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
    export default {
        name: "add",
        data() {
            return {
                form: {
                    name: '',
                    region: '',
                    resource: '',
                }
            }
        },
        created(){
            var that = this;
            this.axios({
                method:"get",
                url:"/static/mock/add.json",
                responseType:"json"
            })
            .then(res=>{
                console.log(res.data);
                that.form = res.data;
            })
            .catch(res=>{
                console.log(res)
            })
        },
        methods: {
            onSubmit() {
                console.log(this.form);
            }
        }
    }
</script>

<style scoped>

  #add_form{
    text-align: left;
  }

</style>
